cmake_minimum_required(VERSION 3.3)

project(lua5.4)

aux_source_directory(../ all_source)
include_directories(../)

set(lib_source ${all_source})
list(REMOVE_ITEM lib_source ..//lua.c ..//luac.c ..//ltests.c)
#message(${lib_source})

add_definitions(-DLUA_USE_LINUX -DLUA_USE_READLINE)

add_library(liblua STATIC ${lib_source})
set_target_properties(liblua PROPERTIES PREFIX "")
install(TARGETS liblua DESTINATION lib)
install(FILES
../lua.h
../luaconf.h
../lualib.h
../lauxlib.h
DESTINATION include)

add_executable(lua ../lua.c)
target_link_libraries(lua liblua readline)
install(TARGETS lua DESTINATION bin)
